package com.csun.cmny.provider.model.service;

import com.csun.cmny.provider.model.service.hystrix.UacGroupFeignApiHystrix;
import com.csun.cmny.provider.model.vo.CountVo;
import com.csun.cmny.provider.model.vo.GroupInforVo;
import com.csun.cmny.provider.model.vo.GroupVo;
import com.csun.cmny.provider.model.vo.RpcGroupVo;
import com.csun.cmny.security.feign.OAuth2FeignAutoConfiguration;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2021-01-07 14:45
 * @Description:
 */
@FeignClient(value = "cmny-provider-uac", configuration = OAuth2FeignAutoConfiguration.class, fallback = UacGroupFeignApiHystrix.class)
public interface UacGroupFeignApi {

    @PostMapping("/api/uac/group/queryGroupList")
    Wrapper<List<RpcGroupVo>> queryGroupList();

    @PostMapping("/api/uac/group/getAllGroup")
    List<GroupInforVo> getAllGroup(@RequestParam("groupId") Long groupId);

    /**
     * 查询该机构及子机构信息
     *
     * @param groupId   the group id
     *
     * @return  the rpc group vo list.
     */
    @PostMapping("/api/uac/group/queryGroupListByGroupId")
    Wrapper<List<GroupVo>> queryGroupListByGroupId(@RequestParam("groupId") Long groupId);

    /**
     * 查询子机构信息
     *
     * @param groupId   the group id
     *
     * @return  the rpc group vo list
     */
    @PostMapping("/api/uac/group/queryChildListByGroupId")
    Wrapper<List<GroupVo>> queryChildListByGroupId(@RequestParam("groupId") Long groupId);

    @PostMapping("/api/uac/group/selectType")
    Wrapper<List<CountVo>> selectType(@RequestParam("groupId") Long groupId);
}
